package com.mrjy.video.dao;

import java.util.List;

import com.mrjy.common.entity.UserVideoRel;
import com.mrjy.common.entity.VideoInfo;
import com.mrjy.video.dto.CoursePackageViewDTO;
import com.mrjy.video.dto.SignInKeepDayDTO;
import com.mrjy.video.dto.StundentRankingDTO;
import com.mrjy.video.dto.VideoViewDTO;

public interface IUserVideoRelDao {
    int deleteByPrimaryKey(Integer id);

    int insert(UserVideoRel record);

    int insertSelective(UserVideoRel record);

    UserVideoRel selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserVideoRel record);

    int updateByPrimaryKey(UserVideoRel record);

	int updateById(UserVideoRel rel);

	int queryByUserIdAndVideoId(UserVideoRel rel);
	/**
	 * 通过用户id和视频类型查询用户查看此类型视频的数量
	 * @param rel
	 * @return
	 */
	public int queryCountByUserIdAndTypeName(UserVideoRel rel);

	UserVideoRel queryInfoByUserIdAndVideoId(UserVideoRel rel);

	int updateByUserIdAndVideoId(UserVideoRel rel);

	int queryTotalFinishedVideoCountByUserId(Integer userId);

    int queryTotalSecVideoCountByUserId(Integer userId);

    /**
	 * 微信1.6-已学课程 观看历史
	 * @param rel.userId
	 * @return
	 */
	List<VideoViewDTO> queryVideoViewHistoryByUserId(UserVideoRel rel);
	/**
	 * 同学排行榜-个人排行榜
	 * @param rel
	 * @return
	 */
	List<StundentRankingDTO> queryStudentsRankingByUserId(UserVideoRel rel);
	/**
	 * 同学排行榜-已观看视频
	 * @param rel
	 * @return
	 */
	List<VideoViewDTO> queryFinishedVideoListByUserId(UserVideoRel rel);
	/**
	 * 已学课程 - 已观看课程包
	 * @param rel
	 * @return
	 */
	List<CoursePackageViewDTO> queryFinishedCoursePackListByUserId(UserVideoRel rel);
	
	/**
	 * 查询用户正在学的视频列表
	 * @param rel
	 * @return
	 */
	List<VideoInfo> queryByUserId(UserVideoRel rel);
	/**
	 * 微信1.6 
	 * 坚持天数--查询个人排名
	 * @param rel.userId
	 * @return
	 */
    List<SignInKeepDayDTO> queryKeepDayRankingListByUserId(UserVideoRel rel);

    List<SignInKeepDayDTO> queryKeepDayRankingListWithoutTeacher();

    int updateDailyStudyTruncate(UserVideoRel userVideoRel);

    List<StundentRankingDTO> queryUserInCourseVideo(Integer coursepackageId);

    int countUserInCourseVideo(Integer coursepackageId);
}